<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*.ecorr.org">
    <link rel="dns-prefetch" href="/wwww.ecorr.org/">
    <title>数据管理系统</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" type="text/css" href="/static/index/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/static/index/css/list.css" />
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
</head>

<body>
    <div class="header inner_c">
        <h1 class="fl"><a href="/" target="_blank" title="数据管理系统" alt="数据管理系统">数据管理系统</a></h1>
		<form action="" accept-charset="utf-8" class="search" id="dw__search" method="get" role="search">
			<div class="soso fl">
				<div class="kuang_w fl">
					<input type="text" id="qsearch__in" accesskey="f" name="q" title="" class="kuang"
						placeholder="请输入关键字" value="{$q ?? ''}">
				</div>
				<div class="sousuo_w fl">
					<input type="button" class="sousuo" id="submit_ym">
                </div>
			</div>
            <!-- 隐藏的earror div -->
            <div class="errmsg fl" class=""></div>
            <!-- 隐藏的earror div end-->
		</form>
        <input type="hidden" name="tablename" id="tablename" value="{$tablename ?? ''}">
        <input type="hidden" name="cid" id="cid" value="{$cid ?? 0}">
    
	</div>
	<!-- 提交按钮jq -->
	<script type="text/javascript">
		$("#submit_ym").click(function () {
            $(".errmsg").html("");
            var tablename = $("#tablename").val();
            var cid = $("#cid").val();
            // console.log($("#tablename").val());
            // console.log($("#cid").val());
            if (!cid || !tablename) {
                $(".errmsg").html("请选择数据表");
                return false;
            }
            $("#dw__search").attr("action", '/index/data_content/datalist/cid/'+cid+'/tablename/'+tablename+'.html');
            // return false;
			$("#dw__search").submit();

		});
	</script>
    <div class="h10 cl"></div>
    <div class="wai">
        <div class="main">
            <!-- 目录 -->
            <div class="main_l fl" id="menu">
                <p class="ysj"><span>首页</span></p>
                <ul class="no1">
                    {foreach $categories as $category}
                    <li>
                        <span class="no1_t cur" onclick="unfolder(this);" style="background:#0379BF;color:#fff;">{$category.name}</span>
                        <ul class="no2">
                            {notempty name="category.child"} {foreach $category.child as $value}
                            {notempty name="value.child"} 
                            <li>
                                <span class="no2_t cur" onclick="unfolderson(this);">{$value.name}</span>
                                <ul class="no3">
                                    {foreach $value.child as $val}
                                    <li><a href="{:url('data_content/datalist', ['cid'=>$val.id, 'tablename'=>$val.tablename])}" class="wikilink1" title="{$val.name}">{$val.name}</a></li>
                                    {/foreach}
                                </ul>
                            </li>
                            {else/}
                            <ul class="no3" style="display: block;">
                                <li><a href="{:url('data_content/datalist', ['cid'=>$value.id, 'tablename'=>$value.tablename])}" class="wikilink1" title="{$value.name}">{$value.name}</a></li>
                            </ul>
                            {/notempty}
                            {/foreach}
                            {/notempty}
                        </ul>
                    </li>
                    {/foreach}
                </ul>
            </div>
            <div class="nei">{__CONTENT__}</div>
        </div>
    </div>
    <!-- 底部的版权信息 -->
    <div class="footer">
        版权所有：国家材料环境腐蚀平台 京ICP备13025191号 京公网安备11010802015897号
    </div>
    <script>
        // 目录展开与搜索
        function unfolder(obj) {
            // // one 只有一个开, 但开一个后关不了
            // $(".main_l .no2").css('display', 'none');
            // $(obj).siblings(".no2").is(":hidden") ? $(obj).siblings(".no2").slideDown(100) : $(obj).siblings(".no2").slideUp(100);
            // two 多开, 但都能关
            $(obj).toggleClass('cur');
            $(obj).siblings(".no2").is(":hidden") ? $(obj).siblings(".no2").slideDown(100) : $(obj).siblings(".no2")
                .slideUp(100);
    
            return false;
        }
    
        function unfolderson(obj) {
            $(obj).toggleClass('cur');
            $(obj).siblings(".no3").is(":hidden") ? $(obj).siblings(".no3").slideDown(100) : $(obj).siblings(".no3")
                .slideUp(100);
            return false;
        }
    </script>
</body>

</html>